<template>
  <div class="it-body">
    <div>
      <span>姓名:</span>
      <el-input class="input" v-model="input" placeholder="请输入用户名称"></el-input>
      <el-button type="primary" icon="el-icon-search">搜索</el-button>
      <div>
        {{city}}
      </div>
    </div>
    <div>
      <el-table
        :data="tableData"
        stripe
        style="width: 100%">
        <el-table-column
          prop="date"
          label="日期"
          width="180">
        </el-table-column>
        <el-table-column
          prop="name"
          label="姓名"
          width="180">
        </el-table-column>
        <el-table-column
          prop="address"
          label="地址">
        </el-table-column>
        <el-table-column
          prop="test"
          label="测试">
        </el-table-column>
      </el-table>
    </div>
    <div>
      <div class="block">
        <span class="demonstration"></span>
        <el-pagination style="float: right;"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage4"
          :page-sizes="[100, 200, 300, 400]"
          :page-size="100"
          layout="total, sizes, prev, pager, next, jumper"
          :total="400">
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
  import axios from 'axios'

  export default {

    data() {
      return {
        input:'',
        city:'',
        tableData: []
      }
    },


    methods:{
      getHomeInfo(){
        // axios.get('/static/mock/package.json')
        // axios.get('http://172.15.0.94:8090/login?username=xiaohong&password=123456')
        //   .then(this.getHomeInfoSucc)

        axios.post('http://172.15.0.94:8090/login', {
          username: 'xiaohong',
          password: '123456'
        })
          .then(function (response) {
            console.log(response);
          })
          .catch(function (error) {
            console.log(error);
          });


      },
      getHomeInfoSucc(res){
        console.log(res)
        res = res.data.data
        this.tableData = res
      }
    },
    mounted(){
      this.getHomeInfo()
    }
  }

</script>

<style scoped>
  .it-body{
    margin: 10px 10px;
    height: auto;
    width: auto;
  }
  .input{
    width: 13%;
    height: auto;
  }

</style>
